package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.warehouse.allot.RegionAllotDO;
import xcmg.device.dao.entity.warehouse.allot.RegionAllotExportNewDO;
import xcmg.device.dao.entity.warehouse.export.RegionAllotExportDO;
import xcmg.device.service.vo.warehouse.allot.RegionAllotVO;

import java.util.List;

@Mapper
public interface RegionAllotMapper {
    int deleteByPrimaryKey(String id);

    int insert(RegionAllotDO record);

    RegionAllotDO selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(RegionAllotDO record);

    int updateByPrimaryKey(RegionAllotDO record);

    List<RegionAllotDO> list(RegionAllotVO condition);
    //查询未被创建发运交接单的区域调拨单
    List<RegionAllotDO> listNotBeCreatedDeliveryReceipt(RegionAllotVO condition);

    List<String> findOrderList(@Param("ids") List<String> ids);

    int remove(@Param("ids") List<String> ids);

    List<RegionAllotDO> findByIds(@Param("ids") List<String> ids);

    RegionAllotDO selectByAllotOrder(@Param("allotOrder") String allotOrder, @Param("orgId") String orgId);

    List<RegionAllotExportDO> findListForExport(@Param("ids") List<String> ids);

    int findCountForExportAll(RegionAllotVO model);

    List<RegionAllotExportDO> findListForExportAll(RegionAllotVO model);

    List<RegionAllotDO> findForDeleteByIds(@Param("ids") List<String> ids);

    int updateInStatus(@Param("status") int status,@Param("billNo") String billNo);
    int updateOutStatus(@Param("status") int status,@Param("billNo") String billNo);

    /**
     * 获取该公司下所有可以领出过账的调拨单
     *
     * @param orgId
     * @return
     */
    List<RegionAllotDO> listOut4SapPosting(@Param("orgId") String orgId);

    /**
     * 获取该公司下所有可以领入过账的调拨单
     *
     * @param orgId
     * @return
     */
    List<RegionAllotDO> listIn4SapPosting(@Param("orgId") String orgId);

    List<RegionAllotDO> findByAllotOrder(List<String> allotOrderList);

    List<RegionAllotDO> findByCrmOrder(String crmOrder);

    List<RegionAllotExportNewDO> selectExportList(RegionAllotVO condition);
}
